# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Dataproc.V1.Model.StreamingQueryProgress do
  @moduledoc """


  ## Attributes

  *   `batchDuration` (*type:* `String.t`, *default:* `nil`) - 
  *   `batchId` (*type:* `String.t`, *default:* `nil`) - 
  *   `durationMillis` (*type:* `map()`, *default:* `nil`) - 
  *   `eventTime` (*type:* `map()`, *default:* `nil`) - 
  *   `name` (*type:* `String.t`, *default:* `nil`) - 
  *   `observedMetrics` (*type:* `map()`, *default:* `nil`) - 
  *   `runId` (*type:* `String.t`, *default:* `nil`) - 
  *   `sink` (*type:* `GoogleApi.Dataproc.V1.Model.SinkProgress.t`, *default:* `nil`) - 
  *   `sources` (*type:* `list(GoogleApi.Dataproc.V1.Model.SourceProgress.t)`, *default:* `nil`) - 
  *   `stateOperators` (*type:* `list(GoogleApi.Dataproc.V1.Model.StateOperatorProgress.t)`, *default:* `nil`) - 
  *   `streamingQueryProgressId` (*type:* `String.t`, *default:* `nil`) - 
  *   `timestamp` (*type:* `String.t`, *default:* `nil`) - 
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :batchDuration => String.t() | nil,
          :batchId => String.t() | nil,
          :durationMillis => map() | nil,
          :eventTime => map() | nil,
          :name => String.t() | nil,
          :observedMetrics => map() | nil,
          :runId => String.t() | nil,
          :sink => GoogleApi.Dataproc.V1.Model.SinkProgress.t() | nil,
          :sources => list(GoogleApi.Dataproc.V1.Model.SourceProgress.t()) | nil,
          :stateOperators => list(GoogleApi.Dataproc.V1.Model.StateOperatorProgress.t()) | nil,
          :streamingQueryProgressId => String.t() | nil,
          :timestamp => String.t() | nil
        }

  field(:batchDuration)
  field(:batchId)
  field(:durationMillis, type: :map)
  field(:eventTime, type: :map)
  field(:name)
  field(:observedMetrics, type: :map)
  field(:runId)
  field(:sink, as: GoogleApi.Dataproc.V1.Model.SinkProgress)
  field(:sources, as: GoogleApi.Dataproc.V1.Model.SourceProgress, type: :list)
  field(:stateOperators, as: GoogleApi.Dataproc.V1.Model.StateOperatorProgress, type: :list)
  field(:streamingQueryProgressId)
  field(:timestamp)
end

defimpl Poison.Decoder, for: GoogleApi.Dataproc.V1.Model.StreamingQueryProgress do
  def decode(value, options) do
    GoogleApi.Dataproc.V1.Model.StreamingQueryProgress.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Dataproc.V1.Model.StreamingQueryProgress do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
